package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the titem database table.
 * 
 */
@Entity
@NamedQuery(name="Titem.findAll", query="SELECT t FROM Titem t")
public class Titem implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int titemid;

	private int tiemchoose;

	private int tiemdu;

	private String titemall;

	private String titemanswer;

	@Temporal(TemporalType.TIMESTAMP)
	private Date titemdate;

	private String titemremark;

	private String titemtypes;

	//bi-directional many-to-one association to Tanswer
	@OneToMany(mappedBy="titem")
	private List<Tanswer> tanswers;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staff_id")
	private Staff staff;

	//bi-directional many-to-many association to Ttest
	@ManyToMany
	@JoinTable(
		name="shijun_tiku"
		, joinColumns={
			@JoinColumn(name="titemid")
			}
		, inverseJoinColumns={
			@JoinColumn(name="ttestid")
			}
		)
	private List<Ttest> ttests;

	public Titem() {
	}

	public int getTitemid() {
		return this.titemid;
	}

	public void setTitemid(int titemid) {
		this.titemid = titemid;
	}

	public int getTiemchoose() {
		return this.tiemchoose;
	}

	public void setTiemchoose(int tiemchoose) {
		this.tiemchoose = tiemchoose;
	}

	public int getTiemdu() {
		return this.tiemdu;
	}

	public void setTiemdu(int tiemdu) {
		this.tiemdu = tiemdu;
	}

	public String getTitemall() {
		return this.titemall;
	}

	public void setTitemall(String titemall) {
		this.titemall = titemall;
	}

	public String getTitemanswer() {
		return this.titemanswer;
	}

	public void setTitemanswer(String titemanswer) {
		this.titemanswer = titemanswer;
	}

	public Date getTitemdate() {
		return this.titemdate;
	}

	public void setTitemdate(Date titemdate) {
		this.titemdate = titemdate;
	}

	public String getTitemremark() {
		return this.titemremark;
	}

	public void setTitemremark(String titemremark) {
		this.titemremark = titemremark;
	}

	public String getTitemtypes() {
		return this.titemtypes;
	}

	public void setTitemtypes(String titemtypes) {
		this.titemtypes = titemtypes;
	}

	public List<Tanswer> getTanswers() {
		return this.tanswers;
	}

	public void setTanswers(List<Tanswer> tanswers) {
		this.tanswers = tanswers;
	}

	public Tanswer addTanswer(Tanswer tanswer) {
		getTanswers().add(tanswer);
		tanswer.setTitem(this);

		return tanswer;
	}

	public Tanswer removeTanswer(Tanswer tanswer) {
		getTanswers().remove(tanswer);
		tanswer.setTitem(null);

		return tanswer;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<Ttest> getTtests() {
		return this.ttests;
	}

	public void setTtests(List<Ttest> ttests) {
		this.ttests = ttests;
	}

}